import request from "@/utils/request";

//获取文章列表
export function getArticleList(pageVo) {
  return request({
    url: "/articles/search",
    method: "post",
    data: pageVo
  });
}
// 根据ID获取文章详情
export function getArticleDetail(articleId) {
  return request({
    url: "/articles/" + articleId
  });
}

//添加文章
export function addArticle(data) {
  return request({
    url: "/articles",
    method: "post",
    data: data
  });
}
// 更新文章
export function updateArticle(data) {
  return request({
    url: "/articles/" + data.id,
    data: data,
    method: "put"
  });
}
// 删除文章
export function deleteArticle(id) {
  return request({
    url: "/articles/" + id,
    method: "delete"
  });
}
